home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Splitter C2931110162001.psc / Test.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-16  |  28.3 KB  |  848 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
  4. Begin VB.Form Form1 
  5.    Caption         =   "Splitter Control Demo"
  6.    ClientHeight    =   6765
  7.    ClientLeft      =   1770
  8.    ClientTop       =   2250
  9.    ClientWidth     =   8505
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6765
  12.    ScaleWidth      =   8505
  13.    Begin MSComctlLib.StatusBar StatusBar1 
  14.       Align           =   2  'Align Bottom
  15.       Height          =   285
  16.       Left            =   0
  17.       TabIndex        =   42
  18.       Top             =   6480
  19.       Width           =   8505
  20.       _ExtentX        =   15002
  21.       _ExtentY        =   503
  22.       _Version        =   393216
  23.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  24.          NumPanels       =   2
  25.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  26.             Object.Width           =   4683
  27.             MinWidth        =   4683
  28.             Text            =   "CurrRatioFromTop: "
  29.             TextSave        =   "CurrRatioFromTop: "
  30.             Key             =   "CurrRatioFromTop"
  31.          EndProperty
  32.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  33.             AutoSize        =   1
  34.             Object.Width           =   9789
  35.             MinWidth        =   3201
  36.             Text            =   "CurrSplitterPos: "
  37.             TextSave        =   "CurrSplitterPos: "
  38.             Key             =   "CurrSplitterPos"
  39.          EndProperty
  40.       EndProperty
  41.    End
  42.    Begin MSComDlg.CommonDialog CommonDialog1 
  43.       Left            =   3960
  44.       Top             =   3480
  45.       _ExtentX        =   847
  46.       _ExtentY        =   847
  47.       _Version        =   393216
  48.       CancelError     =   -1  'True
  49.    End
  50.    Begin VB.Frame fraControlPanel 
  51.       Caption         =   "Splitter Control Panel"
  52.       Height          =   6255
  53.       Left            =   120
  54.       TabIndex        =   5
  55.       Top             =   120
  56.       Width           =   3735
  57.       Begin VB.Frame fraControls 
  58.          BorderStyle     =   0  'None
  59.          Caption         =   "Behavior"
  60.          Height          =   1215
  61.          Index           =   1
  62.          Left            =   960
  63.          TabIndex        =   45
  64.          Top             =   3240
  65.          Visible         =   0   'False
  66.          Width           =   2655
  67.          Begin VB.ComboBox cmbLiveUpdate 
  68.             Height          =   315
  69.             Left            =   1440
  70.             Style           =   2  'Dropdown List
  71.             TabIndex        =   48
  72.             Top             =   360
  73.             Width           =   1215
  74.          End
  75.          Begin VB.ComboBox cmbMaintain 
  76.             Height          =   315
  77.             ItemData        =   "Test.frx":0000
  78.             Left            =   1440
  79.             List            =   "Test.frx":0002
  80.             Style           =   2  'Dropdown List
  81.             TabIndex        =   47
  82.             Top             =   720
  83.             Width           =   1215
  84.          End
  85.          Begin VB.ComboBox cmbAllowResize 
  86.             Height          =   315
  87.             Left            =   1440
  88.             Style           =   2  'Dropdown List
  89.             TabIndex        =   46
  90.             Top             =   0
  91.             Width           =   1215
  92.          End
  93.          Begin VB.Label Label6 
  94.             Caption         =   "Maintain"
  95.             Height          =   255
  96.             Left            =   0
  97.             TabIndex        =   51
  98.             Top             =   750
  99.             Width           =   1455
  100.          End
  101.          Begin VB.Label Label5 
  102.             Caption         =   "LiveUpdate"
  103.             Height          =   255
  104.             Left            =   0
  105.             TabIndex        =   50
  106.             Top             =   390
  107.             Width           =   1455
  108.          End
  109.          Begin VB.Label Label21 
  110.             Caption         =   "AllowResize"
  111.             Height          =   255
  112.             Left            =   0
  113.             TabIndex        =   49
  114.             Top             =   30
  115.             Width           =   1455
  116.          End
  117.       End
  118.       Begin VB.ComboBox cmbSplitter 
  119.          Height          =   315
  120.          Left            =   960
  121.          Style           =   2  'Dropdown List
  122.          TabIndex        =   40
  123.          Top             =   360
  124.          Width           =   1215
  125.       End
  126.       Begin VB.Frame fraControls 
  127.          BorderStyle     =   0  'None
  128.          Caption         =   "Appearance"
  129.          Height          =   1455
  130.          Index           =   0
  131.          Left            =   960
  132.          TabIndex        =   31
  133.          Top             =   1680
  134.          Visible         =   0   'False
  135.          Width           =   2655
  136.          Begin VB.ComboBox cmbBorderStyle 
  137.             Height          =   315
  138.             Left            =   1440
  139.             Style           =   2  'Dropdown List
  140.             TabIndex        =   35
  141.             Top             =   0
  142.             Width           =   1215
  143.          End
  144.          Begin VB.ComboBox cmbSplitterAppearance 
  145.             Height          =   315
  146.             Left            =   1440
  147.             Style           =   2  'Dropdown List
  148.             TabIndex        =   34
  149.             Top             =   360
  150.             Width           =   1215
  151.          End
  152.          Begin VB.ComboBox cmbSplitterBorder 
  153.             Height          =   315
  154.             Left            =   1440
  155.             Style           =   2  'Dropdown List
  156.             TabIndex        =   33
  157.             Top             =   720
  158.             Width           =   1215
  159.          End
  160.          Begin VB.CommandButton cmdSplitterColor 
  161.             Caption         =   "Color"
  162.             Height          =   315
  163.             Left            =   1800
  164.             TabIndex        =   32
  165.             Top             =   1080
  166.             Width           =   855
  167.          End
  168.          Begin VB.Shape shpSplitterColor 
  169.             FillStyle       =   0  'Solid
  170.             Height          =   255
  171.             Left            =   1440
  172.             Top             =   1110
  173.             Width           =   255
  174.          End
  175.          Begin VB.Label Label1 
  176.             Caption         =   "BorderStyle"
  177.             Height          =   255
  178.             Left            =   0
  179.             TabIndex        =   39
  180.             Top             =   30
  181.             Width           =   1455
  182.          End
  183.          Begin VB.Label Label2 
  184.             Caption         =   "SplitterAppearance"
  185.             Height          =   255
  186.             Left            =   0
  187.             TabIndex        =   38
  188.             Top             =   390
  189.             Width           =   1455
  190.          End
  191.          Begin VB.Label Label3 
  192.             Caption         =   "SplitterBorder"
  193.             Height          =   255
  194.             Left            =   0
  195.             TabIndex        =   37
  196.             Top             =   750
  197.             Width           =   1455
  198.          End
  199.          Begin VB.Label Label4 
  200.             Caption         =   "SplitterColor"
  201.             Height          =   255
  202.             Left            =   0
  203.             TabIndex        =   36
  204.             Top             =   1110
  205.             Width           =   1455
  206.          End
  207.       End
  208.       Begin VB.Frame fraControls 
  209.          BorderStyle     =   0  'None
  210.          Caption         =   "Misc"
  211.          Height          =   735
  212.          Index           =   2
  213.          Left            =   960
  214.          TabIndex        =   26
  215.          Top             =   4560
  216.          Visible         =   0   'False
  217.          Width           =   2655
  218.          Begin VB.TextBox txtChild2 
  219.             Height          =   285
  220.             Left            =   1440
  221.             TabIndex        =   28
  222.             Top             =   360
  223.             Width           =   1215
  224.          End
  225.          Begin VB.TextBox txtChild1 
  226.             Height          =   285
  227.             Left            =   1440
  228.             TabIndex        =   27
  229.             Top             =   0
  230.             Width           =   1215
  231.          End
  232.          Begin VB.Label Label7 
  233.             Caption         =   "Child1"
  234.             Height          =   255
  235.             Left            =   0
  236.             TabIndex        =   30
  237.             Top             =   15
  238.             Width           =   1455
  239.          End
  240.          Begin VB.Label Label8 
  241.             Caption         =   "Child2"
  242.             Height          =   255
  243.             Left            =   0
  244.             TabIndex        =   29
  245.             Top             =   375
  246.             Width           =   1455
  247.          End
  248.       End
  249.       Begin VB.Frame fraControls 
  250.          BorderStyle     =   0  'None
  251.          Caption         =   "Position"
  252.          Height          =   3255
  253.          Index           =   3
  254.          Left            =   480
  255.          TabIndex        =   7
  256.          Top             =   1200
  257.          Visible         =   0   'False
  258.          Width           =   2655
  259.          Begin VB.TextBox txtSplitterSize 
  260.             Height          =   285
  261.             Left            =   1440
  262.             TabIndex        =   16
  263.             Top             =   2880
  264.             Width           =   1215
  265.          End
  266.          Begin VB.TextBox txtSplitterPos 
  267.             Height          =   285
  268.             Left            =   1440
  269.             TabIndex        =   15
  270.             Top             =   2520
  271.             Width           =   1215
  272.          End
  273.          Begin VB.TextBox txtRatioFromTop 
  274.             Height          =   285
  275.             Left            =   1440
  276.             TabIndex        =   14
  277.             Top             =   2160
  278.             Width           =   1215
  279.          End
  280.          Begin VB.TextBox txtMinSizeAux 
  281.             Height          =   285
  282.             Left            =   1440
  283.             TabIndex        =   13
  284.             Top             =   1440
  285.             Width           =   1215
  286.          End
  287.          Begin VB.TextBox txtMinSize2 
  288.             Height          =   285
  289.             Left            =   1440
  290.             TabIndex        =   12
  291.             Top             =   1080
  292.             Width           =   1215
  293.          End
  294.          Begin VB.TextBox txtMinSize1 
  295.             Height          =   285
  296.             Left            =   1440
  297.             TabIndex        =   11
  298.             Top             =   720
  299.             Width           =   1215
  300.          End
  301.          Begin VB.TextBox txtMaxSize 
  302.             Height          =   285
  303.             Left            =   1440
  304.             TabIndex        =   10
  305.             Top             =   0
  306.             Width           =   1215
  307.          End
  308.          Begin VB.ComboBox cmbOrientation 
  309.             Height          =   315
  310.             Left            =   1440
  311.             Style           =   2  'Dropdown List
  312.             TabIndex        =   9
  313.             Top             =   1800
  314.             Width           =   1215
  315.          End
  316.          Begin VB.ComboBox cmbMaxSizeAppliesTo 
  317.             Height          =   315
  318.             Left            =   1440
  319.             Style           =   2  'Dropdown List
  320.             TabIndex        =   8
  321.             Top             =   360
  322.             Width           =   1215
  323.          End
  324.          Begin VB.Label Label17 
  325.             Caption         =   "RatioFromTop"
  326.             Height          =   255
  327.             Left            =   0
  328.             TabIndex        =   25
  329.             Top             =   2175
  330.             Width           =   1455
  331.          End
  332.          Begin VB.Label Label16 
  333.             Caption         =   "Orientation"
  334.             Height          =   255
  335.             Left            =   0
  336.             TabIndex        =   24
  337.             Top             =   1830
  338.             Width           =   1455
  339.          End
  340.          Begin VB.Label Label15 
  341.             Caption         =   "MinSizeAux"
  342.             Height          =   255
  343.             Left            =   0
  344.             TabIndex        =   23
  345.             Top             =   1455
  346.             Width           =   1455
  347.          End
  348.          Begin VB.Label Label14 
  349.             Caption         =   "MinSize2"
  350.             Height          =   255
  351.             Left            =   0
  352.             TabIndex        =   22
  353.             Top             =   1095
  354.             Width           =   1455
  355.          End
  356.          Begin VB.Label Label13 
  357.             Caption         =   "MinSize1"
  358.             Height          =   255
  359.             Left            =   0
  360.             TabIndex        =   21
  361.             Top             =   735
  362.             Width           =   1455
  363.          End
  364.          Begin VB.Label Label12 
  365.             Caption         =   "MaxSizeAppliesTo"
  366.             Height          =   255
  367.             Left            =   0
  368.             TabIndex        =   20
  369.             Top             =   390
  370.             Width           =   1455
  371.          End
  372.          Begin VB.Label Label11 
  373.             Caption         =   "SplitterPos"
  374.             Height          =   255
  375.             Left            =   0
  376.             TabIndex        =   19
  377.             Top             =   2535
  378.             Width           =   1455
  379.          End
  380.          Begin VB.Label Label10 
  381.             Caption         =   "SplitterSize"
  382.             Height          =   255
  383.             Left            =   0
  384.             TabIndex        =   18
  385.             Top             =   2895
  386.             Width           =   1455
  387.          End
  388.          Begin VB.Label Label9 
  389.             Caption         =   "MaxSize"
  390.             Height          =   255
  391.             Left            =   0
  392.             TabIndex        =   17
  393.             Top             =   15
  394.             Width           =   1455
  395.          End
  396.       End
  397.       Begin MSComctlLib.TabStrip TabStrip1 
  398.          Height          =   3855
  399.          Left            =   240
  400.          TabIndex        =   6
  401.          Top             =   840
  402.          Width           =   3255
  403.          _ExtentX        =   5741
  404.          _ExtentY        =   6800
  405.          HotTracking     =   -1  'True
  406.          Separators      =   -1  'True
  407.          _Version        =   393216
  408.          BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
  409.             NumTabs         =   4
  410.             BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  411.                Caption         =   "Appearance"
  412.                ImageVarType    =   2
  413.             EndProperty
  414.             BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  415.                Caption         =   "Behavior"
  416.                ImageVarType    =   2
  417.             EndProperty
  418.             BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  419.                Caption         =   "Misc"
  420.                ImageVarType    =   2
  421.             EndProperty
  422.             BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  423.                Caption         =   "Position"
  424.                ImageVarType    =   2
  425.             EndProperty
  426.          EndProperty
  427.       End
  428.       Begin VB.Label Label19 
  429.          Caption         =   $"Test.frx":0004
  430.          Height          =   855
  431.          Left            =   240
  432.          TabIndex        =   44
  433.          Top             =   5280
  434.          Width           =   3255
  435.       End
  436.       Begin VB.Label Label18 
  437.          Caption         =   "-- Press enter in text boxes to accept values, escape to cancel."
  438.          Height          =   495
  439.          Left            =   240
  440.          TabIndex        =   43
  441.          Top             =   4800
  442.          Width           =   3255
  443.       End
  444.       Begin VB.Label Label20 
  445.          Caption         =   "Splitter"
  446.          Height          =   255
  447.          Left            =   240
  448.          TabIndex        =   41
  449.          Top             =   390
  450.          Width           =   615
  451.       End
  452.    End
  453.    Begin Project1.Splitter Splitter1 
  454.       Height          =   3225
  455.       Left            =   3960
  456.       TabIndex        =   0
  457.       Top             =   120
  458.       Width           =   4455
  459.       _ExtentX        =   7858
  460.       _ExtentY        =   5689
  461.       SplitterPos     =   1790
  462.       RatioFromTop    =   0.41
  463.       Child1          =   "treeview1"
  464.       Child2          =   "splitter2"
  465.       Begin Project1.Splitter Splitter2 
  466.          Height          =   3225
  467.          Left            =   1865
  468.          TabIndex        =   2
  469.          Top             =   0
  470.          Width           =   2590
  471.          _ExtentX        =   4577
  472.          _ExtentY        =   5689
  473.          Orientation     =   1
  474.          SplitterPos     =   1001
  475.          RatioFromTop    =   0.322
  476.          Child1          =   "listview1"
  477.          Child2          =   "frame2"
  478.          MaxSize         =   2000
  479.          MinSize2        =   1000
  480.          MinSizeAux      =   2000
  481.          Begin MSComctlLib.ListView ListView1 
  482.             Height          =   1030
  483.             Left            =   -15
  484.             TabIndex        =   4
  485.             Top             =   -15
  486.             Width           =   2625
  487.             _ExtentX        =   4630
  488.             _ExtentY        =   1826
  489.             View            =   3
  490.             LabelWrap       =   -1  'True
  491.             HideSelection   =   -1  'True
  492.             _Version        =   393217
  493.             ForeColor       =   -2147483640
  494.             BackColor       =   -2147483643
  495.             BorderStyle     =   1
  496.             Appearance      =   1
  497.             NumItems        =   2
  498.             BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  499.                Text            =   "Column 1"
  500.                Object.Width           =   2540
  501.             EndProperty
  502.             BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  503.                SubItemIndex    =   1
  504.                Text            =   "Column 2"
  505.                Object.Width           =   2540
  506.             EndProperty
  507.          End
  508.          Begin VB.Frame Frame2 
  509.             Caption         =   "Frame2"
  510.             Height          =   2150
  511.             Left            =   0
  512.             TabIndex        =   3
  513.             Top             =   1075
  514.             Width           =   2595
  515.          End
  516.       End
  517.       Begin MSComctlLib.TreeView TreeView1 
  518.          Height          =   3225
  519.          Left            =   0
  520.          TabIndex        =   1
  521.          Top             =   0
  522.          Width           =   1790
  523.          _ExtentX        =   3149
  524.          _ExtentY        =   5689
  525.          _Version        =   393217
  526.          Style           =   7
  527.          Appearance      =   1
  528.       End
  529.    End
  530. Attribute VB_Name = "Form1"
  531. Attribute VB_GlobalNameSpace = False
  532. Attribute VB_Creatable = False
  533. Attribute VB_PredeclaredId = True
  534. Attribute VB_Exposed = False
  535. Option Explicit
  536. Dim gsplitCurr As Splitter
  537. Dim gintCurrTab As Integer
  538. Function HandleKeyPress(txtBox As TextBox, KeyAscii As Integer, property As String) As Boolean
  539.     Dim result As Boolean
  540.     result = False
  541.     Select Case KeyAscii
  542.     Case vbKeyReturn
  543.         txtBox.SelStart = 0
  544.         txtBox.SelLength = Len(txtBox.Text)
  545.         property = txtBox.Text
  546.         
  547.         KeyAscii = 0
  548.         result = True
  549.     Case vbKeyEscape
  550.         txtBox.Text = property
  551.         txtBox.SelStart = 0
  552.         txtBox.SelLength = Len(txtBox.Text)
  553.         
  554.         KeyAscii = 0
  555.         result = True
  556.     End Select
  557.     HandleKeyPress = result
  558. End Function
  559. Sub SetSplitterControlPanel()
  560.     With gsplitCurr
  561.         'Appearance
  562.         cmbBorderStyle.ListIndex = .BorderStyle
  563.         cmbSplitterAppearance.ListIndex = .SplitterAppearance
  564.         cmbSplitterBorder.ListIndex = .SplitterBorder
  565.         shpSplitterColor.FillColor = .SplitterColor
  566.         
  567.         'Behavior
  568.         If gsplitCurr.AllowResize Then
  569.             cmbAllowResize.ListIndex = 1
  570.         Else
  571.             cmbAllowResize.ListIndex = 0
  572.         End If
  573.         
  574.         If gsplitCurr.LiveUpdate Then
  575.             cmbLiveUpdate.ListIndex = 1
  576.         Else
  577.             cmbLiveUpdate.ListIndex = 0
  578.         End If
  579.         
  580.         cmbMaintain.ListIndex = .Maintain
  581.         
  582.         'Misc
  583.         txtChild1.Text = .Child1
  584.         txtChild2.Text = .Child2
  585.         
  586.         'Position
  587.         txtMaxSize.Text = .MaxSize
  588.         cmbMaxSizeAppliesTo.ListIndex = .MaxSizeAppliesTo
  589.         txtMinSize1.Text = .MinSize1
  590.         txtMinSize2.Text = .MinSize2
  591.         txtMinSizeAux.Text = .MinSizeAux
  592.         cmbOrientation.ListIndex = .Orientation
  593.         txtRatioFromTop.Text = .RatioFromTop
  594.         txtSplitterPos.Text = .SplitterPos
  595.         txtSplitterSize.Text = .SplitterSize
  596.     End With
  597. End Sub
  598. Sub UpdateSplitterCoords(number As Integer)
  599.     If number = cmbSplitter.ListIndex + 1 Then
  600.         txtRatioFromTop.Text = gsplitCurr.RatioFromTop
  601.         txtSplitterPos.Text = gsplitCurr.SplitterPos
  602.         
  603.         StatusBar1.Panels("CurrRatioFromTop").Text = "CurrRatioFromTop: " & gsplitCurr.CurrRatioFromTop
  604.         StatusBar1.Panels("CurrSplitterPos").Text = "CurrSplitterPos: " & gsplitCurr.CurrSplitterPos
  605.     End If
  606. End Sub
  607. Private Sub cmbAllowResize_Click()
  608.     Select Case cmbAllowResize.ListIndex
  609.     Case 0
  610.         gsplitCurr.AllowResize = False
  611.     Case 1
  612.         gsplitCurr.AllowResize = True
  613.     End Select
  614. End Sub
  615. Private Sub cmbBorderStyle_Click()
  616.     gsplitCurr.BorderStyle = cmbBorderStyle.ListIndex
  617. End Sub
  618. Private Sub cmbLiveUpdate_Click()
  619.     Select Case cmbLiveUpdate.ListIndex
  620.     Case 0
  621.         gsplitCurr.LiveUpdate = False
  622.     Case 1
  623.         gsplitCurr.LiveUpdate = True
  624.     End Select
  625. End Sub
  626. Private Sub cmbMaintain_Click()
  627.     gsplitCurr.Maintain = cmbMaintain.ListIndex
  628. End Sub
  629. Private Sub cmbMaxSizeAppliesTo_Click()
  630.     gsplitCurr.MaxSizeAppliesTo = cmbMaxSizeAppliesTo.ListIndex
  631. End Sub
  632. Private Sub cmbOrientation_Click()
  633.     gsplitCurr.Orientation = cmbOrientation.ListIndex
  634. End Sub
  635. Private Sub cmbSplitter_Click()
  636.     Select Case cmbSplitter.ListIndex
  637.     Case 0
  638.         Set gsplitCurr = Splitter1
  639.         SetSplitterControlPanel
  640.     Case 1
  641.         Set gsplitCurr = Splitter2
  642.         SetSplitterControlPanel
  643.     End Select
  644. End Sub
  645. Private Sub cmbSplitterAppearance_Click()
  646.     gsplitCurr.SplitterAppearance = cmbSplitterAppearance.ListIndex
  647. End Sub
  648. Private Sub cmbSplitterBorder_Click()
  649.     gsplitCurr.SplitterBorder = cmbSplitterBorder.ListIndex
  650. End Sub
  651. Private Sub cmdSplitterColor_Click()
  652.     On Error Resume Next
  653.     CommonDialog1.Flags = cdlCCFullOpen + cdlCCRGBInit
  654.     CommonDialog1.Color = gsplitCurr.SplitterColor
  655.     CommonDialog1.ShowColor
  656.     If Err.number = 0 Then
  657.         gsplitCurr.SplitterColor = CommonDialog1.Color
  658.         shpSplitterColor.FillColor = gsplitCurr.SplitterColor
  659.     Else
  660.         If Err.number <> cdlCancel Then
  661.             With Err
  662.                 .Raise .number, .Source, .Description, .HelpFile, .HelpContext
  663.             End With
  664.         End If
  665.     End If
  666. End Sub
  667. Private Sub Form_Load()
  668.     '----- Populate Splitter Control Panel controls
  669.     'Splitter combo
  670.     With cmbSplitter
  671.         .AddItem "Splitter1"
  672.         .AddItem "Splitter2"
  673.     End With
  674.     'Appearance
  675.     With cmbBorderStyle
  676.         .AddItem "None"
  677.         .AddItem "Fixed Single"
  678.     End With
  679.     With cmbSplitterAppearance
  680.         .AddItem "Flat"
  681.         .AddItem "3D"
  682.     End With
  683.     With cmbSplitterBorder
  684.         .AddItem "None"
  685.         .AddItem "Fixed Single"
  686.     End With
  687.     'Behavior
  688.     With cmbAllowResize
  689.         .AddItem "False"
  690.         .AddItem "True"
  691.     End With
  692.     With cmbLiveUpdate
  693.         .AddItem "False"
  694.         .AddItem "True"
  695.     End With
  696.     With cmbMaintain
  697.         .AddItem "MN_POS"
  698.         .AddItem "MN_RATIO"
  699.     End With
  700.     'Position
  701.     With cmbMaxSizeAppliesTo
  702.         .AddItem "MX_CHILD1"
  703.         .AddItem "MX_CHILD2"
  704.     End With
  705.     With cmbOrientation
  706.         .AddItem "OC_HORIZONTAL"
  707.         .AddItem "OC_VERTICAL"
  708.     End With
  709.     '----- Initialize Splitter Control Panel controls
  710.     cmbSplitter.ListIndex = 0
  711.     SetSplitterControlPanel
  712.     gintCurrTab = 1
  713.     TabStrip1_Click
  714.     '----- Populate Splitter contained controls
  715.     TreeView1.Nodes.Add , , , "Node 1"
  716.     TreeView1.Nodes.Add 1, tvwChild, , "Node 2"
  717.     TreeView1.Nodes.Add 1, tvwChild, , "Node 3"
  718.     TreeView1.Nodes.Add , , , "Node 4"
  719.     TreeView1.Nodes(1).Expanded = True
  720.     ListView1.ListItems.Add , , "Item 1"
  721.     ListView1.ListItems(1).SubItems(1) = "Subitem 1"
  722.     ListView1.ListItems.Add , , "Item 2"
  723.     ListView1.ListItems(2).SubItems(1) = "Subitem 2"
  724. End Sub
  725. Private Sub Form_Resize()
  726.     Dim newWidth As Integer
  727.     Dim newHeight As Integer
  728.     With Splitter1
  729.         newWidth = Form1.ScaleWidth - .Left
  730.         If newWidth < 0 Then
  731.             newWidth = 0
  732.         End If
  733.         
  734.         newHeight = Form1.ScaleHeight - StatusBar1.Height - .Top
  735.         If newHeight < 0 Then
  736.             newHeight = 0
  737.         End If
  738.         
  739.         .Move .Left, .Top, newWidth, newHeight
  740.     End With
  741. End Sub
  742. Private Sub Splitter1_Resize()
  743.     UpdateSplitterCoords 1
  744. End Sub
  745. Private Sub Splitter2_Resize()
  746.     UpdateSplitterCoords 2
  747. End Sub
  748. Private Sub TabStrip1_Click()
  749.     With TabStrip1
  750.         fraControls(gintCurrTab).Visible = False
  751.         gintCurrTab = .SelectedItem.Index - 1
  752.         fraControls(gintCurrTab).Move .ClientLeft + 120, .ClientTop + 120, .ClientWidth - 120, .ClientHeight - 120
  753.         fraControls(gintCurrTab).Visible = True
  754.     End With
  755. End Sub
  756. Private Sub txtChild1_KeyPress(KeyAscii As Integer)
  757.     Dim property As String
  758.     With gsplitCurr
  759.         property = .Child1
  760.         If HandleKeyPress(txtChild1, KeyAscii, property) Then
  761.             .Child1 = property
  762.             txtChild1.Text = .Child1
  763.         End If
  764.     End With
  765. End Sub
  766. Private Sub txtChild2_KeyPress(KeyAscii As Integer)
  767.     Dim property As String
  768.     With gsplitCurr
  769.         property = .Child2
  770.         If HandleKeyPress(txtChild2, KeyAscii, property) Then
  771.             .Child2 = property
  772.             txtChild2.Text = .Child2
  773.         End If
  774.     End With
  775. End Sub
  776. Private Sub txtMaxSize_KeyPress(KeyAscii As Integer)
  777.     Dim property As String
  778.     With gsplitCurr
  779.         property = .MaxSize
  780.         If HandleKeyPress(txtMaxSize, KeyAscii, property) Then
  781.             .MaxSize = property
  782.             txtMaxSize.Text = .MaxSize
  783.         End If
  784.     End With
  785. End Sub
  786. Private Sub txtMinSize1_KeyPress(KeyAscii As Integer)
  787.     Dim property As String
  788.     With gsplitCurr
  789.         property = .MinSize1
  790.         If HandleKeyPress(txtMinSize1, KeyAscii, property) Then
  791.             .MinSize1 = property
  792.             txtMinSize1.Text = .MinSize1
  793.         End If
  794.     End With
  795. End Sub
  796. Private Sub txtMinSize2_KeyPress(KeyAscii As Integer)
  797.     Dim property As String
  798.     With gsplitCurr
  799.         property = .MinSize2
  800.         If HandleKeyPress(txtMinSize2, KeyAscii, property) Then
  801.             .MinSize2 = property
  802.             txtMinSize2.Text = .MinSize2
  803.         End If
  804.     End With
  805. End Sub
  806. Private Sub txtMinSizeAux_KeyPress(KeyAscii As Integer)
  807.     Dim property As String
  808.     With gsplitCurr
  809.         property = .MinSizeAux
  810.         If HandleKeyPress(txtMinSizeAux, KeyAscii, property) Then
  811.             .MinSizeAux = property
  812.             txtMinSizeAux = .MinSizeAux
  813.         End If
  814.     End With
  815. End Sub
  816. Private Sub txtRatioFromTop_KeyPress(KeyAscii As Integer)
  817.     Dim property As String
  818.     With gsplitCurr
  819.         property = .RatioFromTop
  820.         If HandleKeyPress(txtRatioFromTop, KeyAscii, property) Then
  821.             .RatioFromTop = property
  822.             txtRatioFromTop.Text = .RatioFromTop
  823.             txtSplitterPos.Text = .SplitterPos
  824.         End If
  825.     End With
  826. End Sub
  827. Private Sub txtSplitterPos_KeyPress(KeyAscii As Integer)
  828.     Dim property As String
  829.     With gsplitCurr
  830.         property = .SplitterPos
  831.         If HandleKeyPress(txtSplitterPos, KeyAscii, property) Then
  832.             .SplitterPos = property
  833.             txtSplitterPos.Text = .SplitterPos
  834.             txtRatioFromTop.Text = .RatioFromTop
  835.         End If
  836.     End With
  837. End Sub
  838. Private Sub txtSplitterSize_KeyPress(KeyAscii As Integer)
  839.     Dim property As String
  840.     With gsplitCurr
  841.         property = .SplitterSize
  842.         If HandleKeyPress(txtSplitterSize, KeyAscii, property) Then
  843.             .SplitterSize = property
  844.             txtSplitterSize.Text = .SplitterSize
  845.         End If
  846.     End With
  847. End Sub
  848.